/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:45 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class ChungchiEntity
    {
        public ChungchiEntity()
        {
			m_pk_ichungchiid=0;
			m_stenchungchi="";
			m_skyhieu="";
			m_blogo=0;
			m_stendonvicap="";
			m_ithangdiem=0;
			m_ithoihan=0;
        }
		private Int16 m_pk_ichungchiid;
		public Int16 PK_iChungchiID
		{
			get { return m_pk_ichungchiid ; }
			set { m_pk_ichungchiid = value; }
		}
		private String m_stenchungchi;
		public String sTenchungchi
		{
			get { return m_stenchungchi ; }
			set { m_stenchungchi = value; }
		}
		private String m_skyhieu;
		public String sKyhieu
		{
			get { return m_skyhieu ; }
			set { m_skyhieu = value; }
		}
		private Byte m_blogo;
		public Byte bLogo
		{
			get { return m_blogo ; }
			set { m_blogo = value; }
		}
		private String m_stendonvicap;
		public String sTendonvicap
		{
			get { return m_stendonvicap ; }
			set { m_stendonvicap = value; }
		}
		private Int16 m_ithangdiem;
		public Int16 iThangdiem
		{
			get { return m_ithangdiem ; }
			set { m_ithangdiem = value; }
		}
		private Byte m_ithoihan;
		public Byte iThoihan
		{
			get { return m_ithoihan ; }
			set { m_ithoihan = value; }
		}

        #region Comparison
        public static List<ChungchiEntity> Sort(List<ChungchiEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(ChungchiEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<ChungchiEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<ChungchiEntity> COMPARISON_PK_iChungchiID
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.PK_iChungchiID.CompareTo(other.PK_iChungchiID);
				};
			}
		}
		public static Comparison<ChungchiEntity> COMPARISON_sTenchungchi
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.sTenchungchi.CompareTo(other.sTenchungchi);
				};
			}
		}
		public static Comparison<ChungchiEntity> COMPARISON_sKyhieu
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.sKyhieu.CompareTo(other.sKyhieu);
				};
			}
		}
		public static Comparison<ChungchiEntity> COMPARISON_bLogo
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.bLogo.CompareTo(other.bLogo);
				};
			}
		}
		public static Comparison<ChungchiEntity> COMPARISON_sTendonvicap
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.sTendonvicap.CompareTo(other.sTendonvicap);
				};
			}
		}
		public static Comparison<ChungchiEntity> COMPARISON_iThangdiem
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.iThangdiem.CompareTo(other.iThangdiem);
				};
			}
		}
		public static Comparison<ChungchiEntity> COMPARISON_iThoihan
		{
			get
			{
				return delegate(ChungchiEntity entity,ChungchiEntity other)
				{
					return entity.iThoihan.CompareTo(other.iThoihan);
				};
			}
		}
        #endregion
    }
}
